package com.yyuap.standard.impl;

import java.util.List;

import com.yyuap.standard.itf.IUser;
import com.yyuap.standard.vo.UserVO;

public class UserImpl implements IUser {

	/**
	 * 查询
	 */
	public List<UserVO> findUser(String condition) {
		// TODO 自动生成的方法存根
		String strwhere = "";
		List<UserVO> users = null;
		UserVO user = new UserVO();
		if (condition != null && !"".equals(condition)) {
			strwhere = "select * from userenterprise where name like '%"
					+ condition + "%' or stuID like '%" + condition + "%'";

		} else {
			strwhere = "select * from userenterprise ";
		}
		users = (List<UserVO>) user.find(strwhere);

		return users.size() == 0 ? null : users;
	}

	/**
	 * 删除
	 */
	public boolean deleteUser(UserVO user) {
		Boolean flag = user.delete();
		return flag;

	}

	/**
	 * 插入
	 */
	public boolean insertUser(UserVO user) {
		Boolean flag = user.save();
		return flag;
	}

	/**
	 * 更新
	 */
	public boolean updateUser(UserVO user) {
		Boolean flag = user.update();
		return flag;
	}

}
